<#include "/include/macros.ftl">
<@header></@header>
<@breadcrumb>
    <ol class="breadcrumb">
        <li><a href="/">首页</a></li>
        <li class="active">详情</li>
    </ol>
</@breadcrumb>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="images/favicon.ico" type="image/ico" />

    <title>待审核</title>

    <!-- Bootstrap -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="../assets/css/nprogress.css" rel="stylesheet">
    <!-- iCheck -->
    <link href="../assets/css/green.css" rel="stylesheet">

    <!-- bootstrap-progressbar -->
    <link href="../assets/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
    <!-- JQVMap -->
    <link href="../assets/css/jqvmap.min.css" rel="stylesheet"/>
    <!-- bootstrap-daterangepicker -->
    <link href="../assets/css/daterangepicker.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="../assets/css/custom.min.css" rel="stylesheet">
    <style>
        *{
            cursor:default
        }
        .center_center{
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .bodys{
            border: 1px solid #ddd
        }
        .title{
            height:70px ;
            position: relative;
        }
        .title>span{
            font-size:20px ;
        }
        .title>button{
            position: absolute;
            top:20px ;
            right: 20px;
        }
        .desc{
            font-size: 18px;
            border-bottom: 1px solid #ddd;
        }
        .coverImage{
            margin-top:10px
        }
        .bodyz{
            width: 100%;
            display: flex;
            flex-flow: column;
            align-items: center;
            padding-top: 50px;
        }
        .bodyz p{
            margin: 0;
            padding: 0;
            margin-bottom: 10px;
            width: 400px;
        }
        .bodyz img{
            display: block;
            margin-bottom: 10px;
            width: 400px;
        }
        .bodyz p>img{
            margin: 0;
        }
        .auther_message{
            display: flex;
            height: 50px;
            align-items: center;
            justify-content: center;
            margin-top: 20px;
        }
        .auther_message>img{
            height: 50px;
            width: 50px;
            border-radius: 50%;
        }
        .auther_message>div{
            width:400px ;
            height: 50px;
            display: flex;
            flex-flow: column;
            justify-content: space-between;
            margin-left: 10px;
        }
        .auther_message>div>span{
            color: rgb(124, 124, 124);
            font-weight: bold;
        }
        .auther_message>div>div{
            display: flex;
            align-items: center;
        }
        .auther_message>div>div>span{
            margin-left: 25px;
        }
        .auther_message>div>div>span:first-of-type{
            margin: 0;
        }
        .auther_message>div>div>span:last-of-type{
            display: block;
            height: 20px;
            width: 40px;
            line-height: 20px;
            text-align: center;
            border: 1px solid rgb(249, 185, 0);
        }
    </style>
</head>

<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <!-- page content 中间的内容-->
        <div class="right_col" role="main">
            <div class="x_content" >
                <label class="col-form-label col-md-3 col-sm-3 label-align"></label>
                <div class="col-md-6 col-sm-6 bodys" >
                    <div class="item form-group center_center title " >
                        <span style="font-weight: bold;">日式简约风格装修效果图</span>
                        <!-- <span style="font-weight: bold;"></span> -->
                        <button  class="btn btn-success  back" >返回</button>
                    </div>
                    <div class="item form-group center_center desc " >
                        <span>发布时间：2019-03-20  15：00</span>
                    </div>

                    <div class="auther_message">
                        <img src="../assets//img/cropper.jpg" alt="">
                        <div>
                            <span>青白设计师</span>
                            <div>
                                <span>三室两厅两卫</span>
                                <span>150平方米</span>
                                <span>平房</span>
                                <span>美式</span>
                            </div>
                        </div>
                    </div>

                    <div class=" form-group bodyz" >
                        <!-- 家装设计内容区域 -->
                    </div>
                </div>
                <!-- 选择商品的弹框 -->
                <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-body">
                                <div class="item form-group">
                                    <div class="col-md-5 col-sm-5 label-align">
                                        是否通过
                                    </div>
                                    <div class="col-md-5 col-sm-5 item" style="align-items: center;">
                                        <input name="Fruit" type="radio" value="" style="height: 20px;width: 20px;" class="pass"/>
                                        <span style="margin-left: 5px;">通过</span>
                                        <input name="Fruit" type="radio" value="" style="height: 20px;width: 20px; margin-left: 20px;" class="notpass" />
                                        <span style="margin-left: 5px;">不通过</span>
                                    </div>
                                </div>
                                <div class="item form-group">
                                    <div class="col-md-5 col-sm-5 label-align">
                                        备注
                                    </div>
                                    <div class="col-md-5 col-sm-5 item">
                                        <textarea  required="required" style="resize:none;height: 200px;width: 200px;" class="remarks"></textarea>
                                    </div>
                                </div>
                                <div class="item form-group" style="justify-content: center;padding-left: 10%;margin-top: 20px;">
                                    <button class="btn btn-secondary "  data-dismiss="modal" aria-label="Close" aria-hidden="true">取消</button>
                                    <button class="btn btn-success tosure" style="margin-left: 50px;" data-dismiss="modal" aria-label="Close" aria-hidden="true">确定</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 选择商品的弹框 -->
            </div>
        </div>
        <!-- /page content中间的内容 -->

        <!-- footer content -->
        <footer>
            <div class="pull-right">
                Gentelella - Bootstrap Admin Template by <a href="https://colorlib.com">Colorlib</a>
            </div>
            <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->

    </div>
</div>
<!-- jQuery -->
<script src="../assets/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="../assets/js/bootstrap.bundle.min.js"></script>
<!-- FastClick -->
<script src="../assets/js/fastclick.js"></script>
<!-- NProgress -->
<script src="../assets/js/nprogress.js"></script>
<!-- Chart.js -->
<script src="../assets/js/Chart.min.js"></script>
<!-- gauge.js -->
<script src="../assets/js/gauge.min.js"></script>
<!-- bootstrap-progressbar -->
<script src="../assets/js/bootstrap-progressbar.min.js"></script>
<!-- iCheck -->
<script src="../assets/js/icheck.min.js"></script>
<!-- jQuery Tags Input -->
<script src="../assets/js/jquery.tagsinput.js"></script>
<!-- bootstrap-wysiwyg -->
<script src="../assets/js/bootstrap-wysiwyg.js"></script>
<script src="../assets/js/jquery.hotkeys.js"></script>
<script src="../assets/js/prettify.js"></script>
<!-- Skycons -->
<script src="../assets/js/skycons.js"></script>
<!-- Flot -->
<script src="../assets/js/jquery.flot.js"></script>
<script src="../assets/js/jquery.flot.pie.js"></script>
<script src="../assets/js/jquery.flot.time.js"></script>
<script src="../assets/js/jquery.flot.stack.js"></script>
<script src="../assets/js/jquery.flot.resize.js"></script>
<!-- Flot plugins -->
<script src="../assets/js/jquery.flot.orderBars.js"></script>
<script src="../assets/js/jquery.flot.spline.min.js"></script>
<script src="../assets/js/curvedLines.js"></script>
<!-- DateJS -->
<script src="../assets/js/date.js"></script>
<!-- JQVMap -->
<script src="../assets/js/jquery.vmap.js"></script>
<script src="../assets/js/jquery.vmap.world.js"></script>
<script src="../assets/js/jquery.vmap.sampledata.js"></script>
<!-- bootstrap-daterangepicker -->
<script src="../assets/js/moment.min.js"></script>
<script src="../assets/js/daterangepicker.js"></script>
<!-- Custom Theme Scripts -->
<script src="../assets/js/custom.min.js"></script>
<!-- Dropzone.js -->
<script src="../assets/js/dropzone.min.js"></script>
<!-- 分页 -->
<script src="../assets/js/pagination.js"></script>
<!-- 地址 -->
<script src="../assets/js/address.js"></script>
<script>
    var id = "${item}";
    console.log(id);
    let message={};
    $(document).ready(function(){
        //获取信息
        let formData = new FormData();
        formData.append('designId',id);
        $.ajax({
            url: 'http://localhost:8086/backstageRotationChart/specific',
            type: "post",
            data: formData,
            processData: false,
            contentType: false,
            success: function(res){
                if(res.code == 0){
                    // console.log(res.data)
                    message=res.data;

                    $('.auther_message>img')[0].src=message.specific.userImage;
                    $('.auther_message>div>span')[0].innerText=message.specific.userName;
                    $('.title>span')[0].innerText=message.specific.designTitle;
                    $(".auther_message>div>div>span:first-of-type")[0].innerText=message.specific.apartmentContent?message.specific.apartmentContent:message.specific.designApartment
                    $(".auther_message>div>div>span:nth-of-type(2)")[0].innerText=message.specific.areaNumber+"平方米";
                    $(".auther_message>div>div>span:nth-of-type(3)")[0].innerText=message.specific.placeContent?message.specific.placeContent:message.specific.designPlace
                    $(".auther_message>div>div>span:nth-of-type(4)")[0].innerText=message.specific.styleContent?message.specific.styleContent:message.specific.designStyle
                    let json=JSON.parse(res.data.specific.designContent);
                    for(let a=0;a<json.ops.length;a++){
                        if(json.ops[a].insert.image){
                            $(".bodyz").append("<img src='"+json.ops[a].insert.image+"'>")
                        }else{
                            let p =document.createElement("p");
                            p.style.whiteSpace='pre';
                            p.innerHTML=json.ops[a].insert;
                            $(".bodyz").append(p)
                        }
                    }
                    $(".bodyz").append('<p style="margin-top:40px">提交时间：'+message.specific.updateTime+'</p>')
                    $(".bodyz").append('<button  class="btn btn-success btn-lg submited" data-toggle="modal" data-target=".bs-example-modal-lg" style="min-width: 200px;margin-top:40px">审核</button>')
                }
            }
        });
        //审核弹框点击确定
        $(".tosure").click(function(){
            if($(".pass")[0].checked){
                let successData = new FormData();
                successData.append('designId',id);
                $.ajax({
                    url: 'http://localhost:8086/backstageRotationChart/success',
                    type: "post",
                    data: formData,
                    processData: false,
                    contentType: false,
                    success: function(res){
                        if(res.code === 0){
                            history.go(-1);
                            console.log('点击返回')
                        }
                    }
                });
                console.log('审核结果为通过')
            }else if($(".notpass")[0].checked){
                if(!$(".remarks")[0].value){
                    alert("审核失败,未填写不通过原因");
                    return
                }else{
                    let loseData = new FormData();
                    loseData.append('designId',id);
                    loseData.append('loseContent',$(".remarks")[0].value);
                    $.ajax({
                        url: 'http://localhost:8086/backstageRotationChart/lose',
                        type: "post",
                        data: formData,
                        processData: false,
                        contentType: false,
                        success: function(res){
                            if(res.code === 0){
                                history.go(-1);
                                console.log('点击返回')
                            }
                        }
                    });
                    console.log('审核结果为不通过,原因是:'+$(".remarks")[0].value)
                }
            }
        });
        //点击返回
        $('.title>.back').click(function(e){
            history.go(-1);
            console.log('点击返回')
        })
    })
</script>
</body>
